package taller2.controller.modes;

import java.awt.event.MouseEvent;

import taller2.interfaces.Graph;
import taller2.utils.Point;
import taller2.view.draws.DrawingArea;

public class AddMode implements Mode{
	private Graph graph;
	
	// constructor
	public AddMode(Graph graph){
		this.graph = graph;
	}
	
	// when the mouse is pressed a node is created
	public void whenPressed(MouseEvent arg0, DrawingArea area) {
		area.getDrawer().unselectNode();
		
		graph.add(new Point(arg0.getX(),arg0.getY()),null);
		area.repaint();
	}


	public void whenReleased(MouseEvent arg0, DrawingArea area) {}

	public void whenDragged(MouseEvent arg0, DrawingArea area) {}

}
